package com.example.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication

@EnableScheduling//定时器注解(项目一启动，方法上带有@Scheduled注解的，就会自动定时)

@MapperScan("com.example.dao")//注入dao层

@ComponentScan(basePackages = { "com.example.service" })//注入service层

@ComponentScan(basePackages = { "com.example.controller" })//注入controller层

@ServletComponentScan//扫描配置的servlet

public class BomescApplication extends SpringBootServletInitializer {
	public static void main(String[] args) {
		SpringApplication.run(BomescApplication.class, args);
	}

	
    /**
     * 工程打成war需要继承SpringBootServletInitializer，重写configure方法，打成war包需要的
     * @date 2018年12月7日
     * @author 
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(BomescApplication.class);
    }
    

}
